// 大文件测试，给服务器发送一个大文件，观察处理结果
/*
上传的文件和服务器保存的文件一致
*/ 

#include "http.hpp"

int main(int argc, char const *argv[])
{
    Socket cli_sock;
    cli_sock.CreateClient("127.0.0.1", 8085);
    std::string req = "PUT /1234.txt HTTP/1.1\r\nConnection: keep-alive\r\n";
    std::string body;
    Util::ReadFile("./hello.txt",&body);
    req += "Content-Length: " + std::to_string(body.size()) + "\r\n\r\n";
    assert(cli_sock.Send((void*)req.c_str(),req.size()) != -1);
    assert(cli_sock.Send((void*)body.c_str(),body.size()) != -1);
    char buf[1024] = {0};
    assert(cli_sock.Recv(buf,1023));
    DBG_LOG("[%s]",buf);
    sleep(3);
    while(1) sleep(1);
    return 0;
}